extends StaticBody2D
class_name StaticObj

var x:float = 100;
var y:float = 100;

func _init(posX,posY):
	self.x = posX;
	self.y = posY;

	# 碰撞体
	self.position = Vector2(x,y);
	
	self.name = "Floor";

	# 外观
	var knight = Sprite.new();
	knight.texture = load("res://Grass.png")
	self.add_child(knight);
	var h = knight.texture.get_height() / 2;
	var w = knight.texture.get_width() / 2;

	# 碰撞盒
	var rect = RectangleShape2D.new();
	rect.extents = Vector2(w,h);
	var oid = self.create_shape_owner(self);
	self.shape_owner_add_shape(oid,rect);
	print("radius",rect.extents);
